// 用户处理模块
const express = require("express");

const router = express.Router();

const socket_handler = require("../controller/socket");

// 导入验证表单数据中间件
const expressJoi = require("@escook/express-joi");
// 导入规则验证对象

router.get("/getdefaultroom", socket_handler.getDefaultRoom);
router.get("/getcurrentroom", socket_handler.getCurrentRoom);
router.get("/getroomusers", socket_handler.getRoomUsers);
router.get("/getmycreaterooms", socket_handler.getMyCreateRooms);
router.get("/getallrooms", socket_handler.getAllRooms);
router.get("/getmyrooms", socket_handler.getMyRooms);
router.post("/createroom", socket_handler.createRoom);
router.post("/joinroom", socket_handler.joinRoom);
router.post("/updateroomisinroom", socket_handler.updateRoomIsInRoom);
router.post("/checkroom", socket_handler.checkRoom);
router.post("/leavemyroom", socket_handler.leaveMyRoom);
router.post("/deleteroom", socket_handler.deleteRoom);
// router.get("/chat", socket_handler.chat);
router.get("/getmessage", socket_handler.getMessage);
router.get("/serchroom", socket_handler.searchRoom);
router.post("/deleteuser", socket_handler.deleteUser);

// 将路由对象共享出去
module.exports = router;
